home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / Appearance.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  71.3 KB  |  1,830 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Appearance.h
  3.  
  4.      Contains:    Appearance Manager & SDK Interfaces.
  5.  
  6.      Version:    Technology:    Appearance 1.0
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __APPEARANCE__
  19. #define __APPEARANCE__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __MACWINDOWS__
  25. #include <MacWindows.h>
  26. #endif
  27. #ifndef __QUICKDRAW__
  28. #include <Quickdraw.h>
  29. #endif
  30. #ifndef __DIALOGS__
  31. #include <Dialogs.h>
  32. #endif
  33. #ifndef __FILES__
  34. #include <Files.h>
  35. #endif
  36. #ifndef __ICONS__
  37. #include <Icons.h>
  38. #endif
  39. #ifndef __CONTROLS__
  40. #include <Controls.h>
  41. #endif
  42. #ifndef __TEXTEDIT__
  43. #include <TextEdit.h>
  44. #endif
  45. #ifndef __QDOFFSCREEN__
  46. #include <QDOffscreen.h>
  47. #endif
  48. #ifndef __TEXTCOMMON__
  49. #include <TextCommon.h>
  50. #endif
  51.  
  52. /*——————————————————————————————————————————————————————————————————————————————————*/
  53. /* Appearance Manager constants, etc.                                                */
  54. /*——————————————————————————————————————————————————————————————————————————————————*/
  55.  
  56.  
  57. #if PRAGMA_ONCE
  58. #pragma once
  59. #endif
  60.  
  61. #ifdef __cplusplus
  62. extern "C" {
  63. #endif
  64.  
  65. #if PRAGMA_IMPORT
  66. #pragma import on
  67. #endif
  68.  
  69. #if PRAGMA_STRUCT_ALIGN
  70.     #pragma options align=mac68k
  71. #elif PRAGMA_STRUCT_PACKPUSH
  72.     #pragma pack(push, 2)
  73. #elif PRAGMA_STRUCT_PACK
  74.     #pragma pack(2)
  75. #endif
  76.  
  77.  
  78. enum {
  79.                                                                 /* Appearance Trap Number */
  80.     _AppearanceDispatch            = 0xAA74
  81. };
  82.  
  83. /* Gestalt selector and values for the Appearance Manager */
  84.  
  85. enum {
  86.     gestaltAppearanceAttr        = FOUR_CHAR_CODE('appr'),
  87.     gestaltAppearanceExists        = 0,
  88.     gestaltAppearanceCompatMode    = 1
  89. };
  90.  
  91. /* Appearance Manager Error Codes */
  92.  
  93. enum {
  94.     appearanceBadBrushIndexErr    = -30560,                        /* pattern index invalid */
  95.     appearanceProcessRegisteredErr = -30561,
  96.     appearanceProcessNotRegisteredErr = -30562,
  97.     appearanceBadTextColorIndexErr = -30563
  98. };
  99.  
  100.  
  101. enum {
  102.     kThemeActiveDialogBackgroundBrush = 1,                        /* Dialogs */
  103.     kThemeInactiveDialogBackgroundBrush = 2,                    /* Dialogs */
  104.     kThemeActiveAlertBackgroundBrush = 3,
  105.     kThemeInactiveAlertBackgroundBrush = 4,
  106.     kThemeActiveModelessDialogBackgroundBrush = 5,
  107.     kThemeInactiveModelessDialogBackgroundBrush = 6,
  108.     kThemeActiveUtilityWindowBackgroundBrush = 7,                /* Miscellaneous */
  109.     kThemeInactiveUtilityWindowBackgroundBrush = 8,                /* Miscellaneous */
  110.     kThemeListViewSortColumnBackgroundBrush = 9,                /* Finder */
  111.     kThemeListViewBackgroundBrush = 10,
  112.     kThemeIconLabelBackgroundBrush = 11,
  113.     kThemeListViewSeparatorBrush = 12,
  114.     kThemeChasingArrowsBrush    = 13,
  115.     kThemeDragHiliteBrush        = 14,
  116.     kThemeDocumentWindowBackgroundBrush = 15,
  117.     kThemeFinderWindowBackgroundBrush = 16
  118. };
  119.  
  120. typedef SInt16                             ThemeBrush;
  121.  
  122. enum {
  123.     kThemeActiveDialogTextColor    = 1,                            /* Dialogs */
  124.     kThemeInactiveDialogTextColor = 2,
  125.     kThemeActiveAlertTextColor    = 3,
  126.     kThemeInactiveAlertTextColor = 4,
  127.     kThemeActiveModelessDialogTextColor = 5,
  128.     kThemeInactiveModelessDialogTextColor = 6,
  129.     kThemeActiveWindowHeaderTextColor = 7,                        /* Primitives */
  130.     kThemeInactiveWindowHeaderTextColor = 8,
  131.     kThemeActivePlacardTextColor = 9,                            /* Primitives */
  132.     kThemeInactivePlacardTextColor = 10,
  133.     kThemePressedPlacardTextColor = 11,
  134.     kThemeActivePushButtonTextColor = 12,                        /* Primitives */
  135.     kThemeInactivePushButtonTextColor = 13,
  136.     kThemePressedPushButtonTextColor = 14,
  137.     kThemeActiveBevelButtonTextColor = 15,                        /* Primitives */
  138.     kThemeInactiveBevelButtonTextColor = 16,
  139.     kThemePressedBevelButtonTextColor = 17,
  140.     kThemeActivePopupButtonTextColor = 18,                        /* Primitives */
  141.     kThemeInactivePopupButtonTextColor = 19,
  142.     kThemePressedPopupButtonTextColor = 20,
  143.     kThemeIconLabelTextColor    = 21,                            /* Finder */
  144.     kThemeListViewTextColor        = 22
  145. };
  146.  
  147. typedef SInt16                             ThemeTextColor;
  148. /* States to draw primitives: disabled, active, and pressed (hilited) */
  149.  
  150. enum {
  151.     kThemeStateDisabled            = 0,
  152.     kThemeStateActive            = 1,
  153.     kThemeStatePressed            = 2
  154. };
  155.  
  156. typedef UInt32                             ThemeDrawState;
  157. /*——————————————————————————————————————————————————————————————————————————————————*/
  158. /* Window Manager constants, etc.                                                    */
  159. /*——————————————————————————————————————————————————————————————————————————————————*/
  160.  
  161. enum {
  162.                                                                 /* Resource IDs for new window defprocs */
  163.     kWindowDocumentDefProcResID    = 64,
  164.     kWindowDialogDefProcResID    = 65,
  165.     kWindowUtilityDefProcResID    = 66,
  166.     kWindowUtilitySideTitleDefProcResID = 67
  167. };
  168.  
  169.  
  170. enum {
  171.                                                                 /* Proc IDs for theme-savvy windows */
  172.     kWindowDocumentProc            = 1024,
  173.     kWindowGrowDocumentProc        = 1025,
  174.     kWindowHorizZoomDocumentProc = 1026,
  175.     kWindowHorizZoomGrowDocumentProc = 1027,
  176.     kWindowVertZoomDocumentProc    = 1028,
  177.     kWindowVertZoomGrowDocumentProc = 1029,
  178.     kWindowFullZoomDocumentProc    = 1030,
  179.     kWindowFullZoomGrowDocumentProc = 1031
  180. };
  181.  
  182.  
  183. enum {
  184.                                                                 /* Proc IDs for theme-savvy dialogs */
  185.     kWindowPlainDialogProc        = 1040,
  186.     kWindowShadowDialogProc        = 1041,
  187.     kWindowModalDialogProc        = 1042,
  188.     kWindowMovableModalDialogProc = 1043,
  189.     kWindowAlertProc            = 1044,
  190.     kWindowMovableAlertProc        = 1045
  191. };
  192.  
  193.  
  194. enum {
  195.                                                                 /* Proc IDs for top title bar theme-savvy floating windows */
  196.     kWindowFloatProc            = 1057,
  197.     kWindowFloatGrowProc        = 1059,
  198.     kWindowFloatHorizZoomProc    = 1061,
  199.     kWindowFloatHorizZoomGrowProc = 1063,
  200.     kWindowFloatVertZoomProc    = 1065,
  201.     kWindowFloatVertZoomGrowProc = 1067,
  202.     kWindowFloatFullZoomProc    = 1069,
  203.     kWindowFloatFullZoomGrowProc = 1071
  204. };
  205.  
  206.  
  207. enum {
  208.                                                                 /* Proc IDs for side title bar theme-savvy floating windows */
  209.     kWindowFloatSideProc        = 1073,
  210.     kWindowFloatSideGrowProc    = 1075,
  211.     kWindowFloatSideHorizZoomProc = 1077,
  212.     kWindowFloatSideHorizZoomGrowProc = 1079,
  213.     kWindowFloatSideVertZoomProc = 1081,
  214.     kWindowFloatSideVertZoomGrowProc = 1083,
  215.     kWindowFloatSideFullZoomProc = 1085,
  216.     kWindowFloatSideFullZoomGrowProc = 1087
  217. };
  218.  
  219.  
  220. enum {
  221.                                                                 /* Region values to pass into GetWindowRegion */
  222.     kWindowTitleBarRgn            = 0,
  223.     kWindowTitleTextRgn            = 1,
  224.     kWindowCloseBoxRgn            = 2,
  225.     kWindowZoomBoxRgn            = 3,
  226.     kWindowDragRgn                = 5,
  227.     kWindowGrowRgn                = 6,
  228.     kWindowCollapseBoxRgn        = 7,
  229.     kWindowStructureRgn            = 32,
  230.     kWindowContentRgn            = 33
  231. };
  232.  
  233. typedef UInt16                             WindowRegionCode;
  234.  
  235. enum {
  236.                                                                 /* Window Features returned by GetWindowFeatures */
  237.     kWindowCanGrow                = (1 << 0),
  238.     kWindowCanZoom                = (1 << 1),
  239.     kWindowCanCollapse            = (1 << 2),
  240.     kWindowIsModal                = (1 << 3),
  241.     kWindowCanGetWindowRegion    = (1 << 4),
  242.     kWindowIsAlert                = (1 << 5),
  243.     kWindowHasTitleBar            = (1 << 6)
  244. };
  245.  
  246.  
  247. enum {
  248.                                                                 /* New window messages */
  249.     kWindowMsgGetFeatures        = 7,
  250.     kWindowMsgGetRegion            = 8
  251. };
  252.  
  253.  
  254. enum {
  255.                                                                 /* New Window part codes */
  256.     inCollapseBox                = 11
  257. };
  258.  
  259.  
  260. enum {
  261.                                                                 /* Window Definition hit test result codes ("WindowPart")*/
  262.     wInCollapseBox                = 9
  263. };
  264.  
  265. /* Window positioning constants */
  266.  
  267. enum {
  268.     kWindowDefaultPosition        = 0x0000,
  269.     kWindowCenterMainScreen        = 0x280A,
  270.     kWindowAlertPositionMainScreen = 0x300A,
  271.     kWindowStaggerMainScreen    = 0x380A,
  272.     kWindowCenterParentWindow    = 0xA80A,
  273.     kWindowAlertPositionParentWindow = 0xB00A,
  274.     kWindowStaggerParentWindow    = 0xB80A,
  275.     kWindowCenterParentWindowScreen = 0x680A,
  276.     kWindowAlertPositionParentWindowScreen = 0x700A,
  277.     kWindowStaggerParentWindowScreen = 0x780A
  278. };
  279.  
  280. /* GetWindowRegionRec - used for WDEF calls with kWindowMsgGetRegion */
  281. struct GetWindowRegionRec {
  282.     RgnHandle                         winRgn;
  283.     WindowRegionCode                 regionCode;
  284. };
  285. typedef struct GetWindowRegionRec GetWindowRegionRec;
  286.  
  287. typedef GetWindowRegionRec *            GetWindowRegionPtr;
  288. /*——————————————————————————————————————————————————————————————————————————————————*/
  289. /* Dialog Manager constants, etc.                                                    */
  290. /*——————————————————————————————————————————————————————————————————————————————————*/
  291.  
  292. enum {
  293.                                                                 /* Alert types to pass into StandardAlert */
  294.     kAlertStopAlert                = 0,
  295.     kAlertNoteAlert                = 1,
  296.     kAlertCautionAlert            = 2,
  297.     kAlertPlainAlert            = 3
  298. };
  299.  
  300. typedef SInt16                             AlertType;
  301.  
  302. enum {
  303.     kAlertDefaultOKText            = -1,                            /* "OK"*/
  304.     kAlertDefaultCancelText        = -1,                            /* "Cancel"*/
  305.     kAlertDefaultOtherText        = -1                            /* "Don't Save"*/
  306. };
  307.  
  308. /* StandardAlert alert button numbers */
  309.  
  310. enum {
  311.     kAlertStdAlertOKButton        = 1,
  312.     kAlertStdAlertCancelButton    = 2,
  313.     kAlertStdAlertOtherButton    = 3,
  314.     kAlertStdAlertHelpButton    = 4
  315. };
  316.  
  317.  
  318. enum {
  319.                                                                 /* Dialog Flags for use in NewFeaturesDialog or dlgx resource */
  320.     kDialogFlagsUseThemeBackground = (1 << 0),
  321.     kDialogFlagsUseControlHierarchy = (1 << 1),
  322.     kDialogFlagsHandleMovableModal = (1 << 2),
  323.     kDialogFlagsUseThemeControls = (1 << 3)
  324. };
  325.  
  326.  
  327. enum {
  328.                                                                 /* Alert Flags for use in alrx resource */
  329.     kAlertFlagsUseThemeBackground = (1 << 0),
  330.     kAlertFlagsUseControlHierarchy = (1 << 1),
  331.     kAlertFlagsAlertIsMovable    = (1 << 2),
  332.     kAlertFlagsUseThemeControls    = (1 << 3)
  333. };
  334.  
  335. /* For dftb resource */
  336.  
  337. enum {
  338.     kDialogFontNoFontStyle        = 0,
  339.     kDialogFontUseFontMask        = 0x0001,
  340.     kDialogFontUseFaceMask        = 0x0002,
  341.     kDialogFontUseSizeMask        = 0x0004,
  342.     kDialogFontUseForeColorMask    = 0x0008,
  343.     kDialogFontUseBackColorMask    = 0x0010,
  344.     kDialogFontUseModeMask        = 0x0020,
  345.     kDialogFontUseJustMask        = 0x0040,
  346.     kDialogFontUseAllMask        = 0x00FF,
  347.     kDialogFontAddFontSizeMask    = 0x0100,
  348.     kDialogFontUseFontMaskMask    = 0x0200
  349. };
  350.  
  351. struct AlertStdAlertParamRec {
  352.     Boolean                         movable;                    /* Make alert movable modal */
  353.     Boolean                         helpButton;                    /* Is there a help button? */
  354.     ModalFilterUPP                     filterProc;                    /* Event filter */
  355.     StringPtr                         defaultText;                /* Text for button in OK position */
  356.     StringPtr                         cancelText;                    /* Text for button in cancel position */
  357.     StringPtr                         otherText;                    /* Text for button in left position */
  358.     SInt16                             defaultButton;                /* Which button behaves as the default */
  359.     SInt16                             cancelButton;                /* Which one behaves as cancel (can be 0) */
  360.     UInt16                             position;                    /* Position (kWindowDefaultPosition in this case */
  361.                                                                 /* equals kWindowAlertPositionParentWindowScreen) */
  362. };
  363. typedef struct AlertStdAlertParamRec AlertStdAlertParamRec;
  364.  
  365. typedef AlertStdAlertParamRec *            AlertStdAlertParamPtr;
  366. /*——————————————————————————————————————————————————————————————————————————————————*/
  367. /* Control Manager constants, etc.                                                    */
  368. /*——————————————————————————————————————————————————————————————————————————————————*/
  369.  
  370. enum {
  371.     _ControlDispatch            = 0xAA73
  372. };
  373.  
  374.  
  375. enum {
  376.                                                                 /* resource types for new controls */
  377.     kControlTabListResType        = FOUR_CHAR_CODE('tab#'),        /* used for tab control only*/
  378.     kControlListDescResType        = FOUR_CHAR_CODE('ldes')        /* used for list box control only*/
  379. };
  380.  
  381.  
  382. enum {
  383.                                                                 /* new part codes for new controls */
  384.     kControlEditTextPart        = 5,
  385.     kControlPicturePart            = 6,
  386.     kControlIconPart            = 7,
  387.     kControlClockPart            = 8,
  388.     kControlListBoxPart            = 24,
  389.     kControlListBoxDoubleClickPart = 25
  390. };
  391.  
  392.  
  393. enum {
  394.     kControlSupportsNewMessages    = FOUR_CHAR_CODE(' ok ')        /* CDEF should return as result of kControlMsgTestNewMsgSupport*/
  395. };
  396.  
  397. /* focusing part codes */
  398.  
  399. enum {
  400.     kControlFocusNoPart            = 0,                            /* tells control to clear its focus*/
  401.     kControlFocusNextPart        = -1,                            /* tells control to focus on the next part*/
  402.     kControlFocusPrevPart        = -2                            /* tells control to focus on the previous part*/
  403. };
  404.  
  405. typedef SInt16                             ControlFocusPart;
  406. /* Key Filter result codes                                                             */
  407. /*                                                                                    */
  408. /* Certain controls can have a keyfilter attached to them. The filter proc should    */
  409. /* return one of the two constants below. If kKeyFilterBlockKey is returned, the    */
  410. /* key is blocked and never makes it to the control. If kKeyFilterPassKey is        */
  411. /* returned, the control receives the keystroke.                                    */
  412.  
  413. enum {
  414.     kControlKeyFilterBlockKey    = 0,
  415.     kControlKeyFilterPassKey    = 1
  416. };
  417.  
  418. typedef SInt16                             ControlKeyFilterResult;
  419. /*——————————————————————————————————————————————————————————————————————————————————————*/
  420. /*     SPECIAL FONT USAGE NOTES: You can specify the font to use for many control types.
  421.     The constants below are meta-font numbers which you can use to set a particular
  422.     control's font usage. There are essentially two modes you can use: 1) default,
  423.     which is essentially the same as it always has been, i.e. it uses the system font, unless
  424.     directed to use the window font via a control variant. 2) you can specify to use
  425.     the big or small system font in a generic manner. The Big system font is the font
  426.     used in menus, etc. Chicago has filled that role for some time now. Small system
  427.     font is currently Geneva 10. The meta-font number implies the size and style.
  428.     
  429.     NOTE:        Not all font attributes are used by all controls. Most, in fact, ignore
  430.                 the fore and back color (Static Text is the only one that does, for
  431.                 backwards compatibility). Also size, face, and addFontSize are ignored
  432.                 when using the meta-font numbering.
  433. */
  434. /*——————————————————————————————————————————————————————————————————————————————————————*/
  435.  
  436. enum {
  437.                                                                 /* Meta-font numbering - see not above */
  438.     kControlFontBigSystemFont    = -1,                            /* force to big system font*/
  439.     kControlFontSmallSystemFont    = -2,                            /* force to small system font*/
  440.     kControlFontSmallBoldSystemFont = -3                        /* force to small bold system font*/
  441. };
  442.  
  443. /* Add these masks together to set the flags field of a ControlFontStyleRec    */
  444. /* They specify which fields to apply to the text. It is important to make    */
  445. /* sure that you specify only the fields that you wish to set.                */
  446.  
  447. enum {
  448.     kControlUseFontMask            = 0x0001,
  449.     kControlUseFaceMask            = 0x0002,
  450.     kControlUseSizeMask            = 0x0004,
  451.     kControlUseForeColorMask    = 0x0008,
  452.     kControlUseBackColorMask    = 0x0010,
  453.     kControlUseModeMask            = 0x0020,
  454.     kControlUseJustMask            = 0x0040,
  455.     kControlUseAllMask            = 0x00FF,
  456.     kControlAddFontSizeMask        = 0x0100
  457. };
  458.  
  459. struct ControlFontStyleRec {
  460.     SInt16                             flags;
  461.     SInt16                             font;
  462.     SInt16                             size;
  463.     SInt16                             style;
  464.     SInt16                             mode;
  465.     SInt16                             just;
  466.     RGBColor                         foreColor;
  467.     RGBColor                         backColor;
  468. };
  469. typedef struct ControlFontStyleRec ControlFontStyleRec;
  470.  
  471. typedef ControlFontStyleRec *            ControlFontStylePtr;
  472. /*——————————————————————————————————————————————————————————————————————————————————————*/
  473. /* Common data tags for Get/SetControlData                                                */
  474. /*——————————————————————————————————————————————————————————————————————————————————————*/
  475.  
  476. enum {
  477.     kControlFontStyleTag        = FOUR_CHAR_CODE('font'),
  478.     kControlKeyFilterTag        = FOUR_CHAR_CODE('fltr')
  479. };
  480.  
  481. /*——————————————————————————————————————————————————————————————————————————————————————*/
  482. /* Errors are in the range -30580 .. -30599                                                */
  483. /*——————————————————————————————————————————————————————————————————————————————————————*/
  484.  
  485. enum {
  486.     errMessageNotSupported        = -30580,
  487.     errDataNotSupported            = -30581,
  488.     errControlDoesntSupportFocus = -30582,
  489.     errWindowDoesntSupportFocus    = -30583,
  490.     errUnknownControl            = -30584,
  491.     errCouldntSetFocus            = -30585,
  492.     errNoRootControl            = -30586,
  493.     errRootAlreadyExists        = -30587,
  494.     errInvalidPartCode            = -30588,
  495.     errControlsAlreadyExist        = -30589,
  496.     errControlIsNotEmbedder        = -30590,
  497.     errDataSizeMismatch            = -30591,
  498.     errControlHiddenOrDisabled    = -30592,
  499.     errWindowRegionCodeInvalid    = -30593,
  500.     errCantEmbedIntoSelf        = -30594,
  501.     errCantEmbedRoot            = -30595,
  502.     errItemNotControl            = -30596
  503. };
  504.  
  505.  
  506. enum {
  507.                                                                 /* Control feature bits - returned by GetControlFeatures */
  508.     kControlSupportsGhosting    = 1 << 0,
  509.     kControlSupportsEmbedding    = 1 << 1,
  510.     kControlSupportsFocus        = 1 << 2,
  511.     kControlWantsIdle            = 1 << 3,
  512.     kControlWantsActivate        = 1 << 4,
  513.     kControlHandlesTracking        = 1 << 5,
  514.     kControlSupportsDataAccess    = 1 << 6,
  515.     kControlHasSpecialBackground = 1 << 7,
  516.     kControlGetsFocusOnClick    = 1 << 8,
  517.     kControlSupportsCalcBestRect = 1 << 9,
  518.     kControlSupportsLiveFeedback = 1 << 10
  519. };
  520.  
  521.  
  522. enum {
  523.                                                                 /* Control Messages */
  524.     kControlMsgDrawGhost        = 13,
  525.     kControlMsgCalcBestRect        = 14,                            /* Calculate best fitting rectangle for control*/
  526.     kControlMsgHandleTracking    = 15,
  527.     kControlMsgFocus            = 16,                            /* param indicates action.*/
  528.     kControlMsgKeyDown            = 17,
  529.     kControlMsgIdle                = 18,
  530.     kControlMsgGetFeatures        = 19,
  531.     kControlMsgSetData            = 20,
  532.     kControlMsgGetData            = 21,
  533.     kControlMsgActivate            = 22,
  534.     kControlMsgSetUpBackground    = 23,
  535.     kControlMsgCalcValue        = 24,
  536.     kControlMsgSubControlHit    = 25,
  537.     kControlMsgCalcValueFromPos    = 26,
  538.     kControlMsgTestNewMsgSupport = 27                            /* See if this control supports new messaging*/
  539. };
  540.  
  541. /*——————————————————————————————————————————————————————————————————————————————————————*/
  542. /*     This structure is passed into a CDEF when called with the kControlMsgHandleTracking    */
  543. /*    message                                                                             */
  544. /*——————————————————————————————————————————————————————————————————————————————————————*/
  545. struct ControlTrackingRec {
  546.     Point                             startPt;
  547.     SInt16                             modifiers;
  548.     ControlActionUPP                 action;
  549. };
  550. typedef struct ControlTrackingRec ControlTrackingRec;
  551.  
  552. typedef ControlTrackingRec *            ControlTrackingPtr;
  553. /*——————————————————————————————————————————————————————————————————————————————————————*/
  554. /* This structure is passed into a CDEF when called with the kControlMsgKeyDown message */
  555. /*——————————————————————————————————————————————————————————————————————————————————————*/
  556. struct ControlKeyDownRec {
  557.     SInt16                             modifiers;
  558.     SInt16                             keyCode;
  559.     SInt16                             charCode;
  560. };
  561. typedef struct ControlKeyDownRec ControlKeyDownRec;
  562.  
  563. typedef ControlKeyDownRec *                ControlKeyDownPtr;
  564. /*——————————————————————————————————————————————————————————————————————————————————————*/
  565. /* This structure is passed into a CDEF when called with the kControlMsgGetData or        */
  566. /* kControlMsgSetData message                                                             */
  567. /*——————————————————————————————————————————————————————————————————————————————————————*/
  568. struct ControlDataAccessRec {
  569.     ResType                         tag;
  570.     ResType                         part;
  571.     Size                             size;
  572.     Ptr                             dataPtr;
  573. };
  574. typedef struct ControlDataAccessRec ControlDataAccessRec;
  575.  
  576. typedef ControlDataAccessRec *            ControlDataAccessPtr;
  577. /*——————————————————————————————————————————————————————————————————————————————————————*/
  578. /* This structure is passed into a CDEF when called with the kControlCalcBestRect msg     */
  579. /*——————————————————————————————————————————————————————————————————————————————————————*/
  580. struct ControlCalcSizeRec {
  581.     SInt16                             height;
  582.     SInt16                             width;
  583.     SInt16                             baseLine;
  584. };
  585. typedef struct ControlCalcSizeRec ControlCalcSizeRec;
  586.  
  587. typedef ControlCalcSizeRec *            ControlCalcSizePtr;
  588. /*——————————————————————————————————————————————————————————————————————————————————————*/
  589. /* This structure is passed into a CDEF when called with the kControlMsgSetUpBackground */
  590. /* message is sent                                                                        */
  591. /*——————————————————————————————————————————————————————————————————————————————————————*/
  592. struct ControlBackgroundRec {
  593.     SInt16                             depth;
  594.     Boolean                         colorDevice;
  595. };
  596. typedef struct ControlBackgroundRec ControlBackgroundRec;
  597.  
  598. typedef ControlBackgroundRec *            ControlBackgroundPtr;
  599. /*——————————————————————————————————————————————————————————————————————————————————————*/
  600. /*    Key Filter                                                                            */
  601. /*                                                                                        */
  602. /* Definition of a key filter for intercepting and possibly changing keystrokes            */
  603. /* which are destined for a control                                                        */
  604. /*——————————————————————————————————————————————————————————————————————————————————————*/
  605. typedef CALLBACK_API( ControlKeyFilterResult , ControlKeyFilterProcPtr )(ControlHandle theControl, SInt16 *keyCode, SInt16 *charCode, SInt16 *modifiers);
  606. typedef STACK_UPP_TYPE(ControlKeyFilterProcPtr)                 ControlKeyFilterUPP;
  607. enum { uppControlKeyFilterProcInfo = 0x00003FE0 };                 /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  608. #define NewControlKeyFilterProc(userRoutine)                     (ControlKeyFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlKeyFilterProcInfo, GetCurrentArchitecture())
  609. #define CallControlKeyFilterProc(userRoutine, theControl, keyCode, charCode, modifiers)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppControlKeyFilterProcInfo, (theControl), (keyCode), (charCode), (modifiers))
  610. /*——————————————————————————————————————————————————————————————————————————————————————*/
  611. /*    • BEVEL BUTTON INTERFACE (CDEF 2)                                                    */
  612. /*——————————————————————————————————————————————————————————————————————————————————————*/
  613. /*    Bevel buttons allow you to control the content type (pict/icon/etc.), the behavior    */
  614. /* (pushbutton/toggle/sticky), and the bevel size. You also have the option of            */
  615. /*    attaching a menu to it. When a menu is present, you can specify which way the         */
  616. /*    popup arrow is facing (down or right).                                                */
  617. /*                                                                                        */
  618. /*    This is all made possible by overloading the Min, Max, and Value parameters for the    */
  619. /*    control, as well as adjusting the variant. Here's the breakdown of what goes where:    */
  620. /*                                                                                        */
  621. /*    Parameter                    What Goes Here                                            */
  622. /*    ———————————————————            ————————————————————————————————————————————————————    */
  623. /*    Min                            Hi Byte = Behavior, Lo Byte = content type.                */
  624. /*    Max                            ResID for resource-based content types.                    */
  625. /*    Value                        MenuID to attach, 0 = no menu, please.                    */
  626. /*                                                                                        */
  627. /*    The variant is broken down into two halfs. The low 2 bits control the bevel type.    */
  628. /*    Bit 2 controls the popup arrow direction (if a menu is present) and bit 3 controls    */
  629. /*    whether or not to use the control's owning window's font.                            */
  630. /*                                                                                        */
  631. /*    Constants for all you need to put this together are below. The values for behaviors    */
  632. /*    are set up so that you can simply add them to the content type and pass them into    */
  633. /*    the Min parameter of NewControl.                                                    */
  634. /*                                                                                        */
  635. /*    An example call:                                                                    */
  636. /*                                                                                        */
  637. /*    control = NewControl( window, &bounds, "\p", true, 0, kContentIconSuiteRes +         */
  638. /*                            kBehaviorToggles, myIconSuiteID, bevelButtonSmallBevelProc,    */
  639. /*                            0L );                                                        */
  640. /*                                                                                        */
  641. /*    Attaching a menu:                                                                    */
  642. /*                                                                                        */
  643. /*    control = NewControl( window, &bounds, "\p", true, kMyMenuID, kContentIconSuiteRes,    */
  644. /*            myIconSuiteID, bevelButtonSmallBevelProc + kBevelButtonMenuOnRight, 0L );    */
  645. /*                                                                                        */
  646. /*    This will attach menu ID kMyMenuID to the button, with the popup arrow facing right.*/
  647. /*    This also puts the menu up to the right of the button. You can also specify that a    */
  648. /*    menu can have multiple items checked at once by adding kBehaviorMultiValueMenus        */
  649. /*    into the Min parameter. If you do use multivalue menus, the GetBevelButtonMenuValue    */
  650. /*    helper function will return the last item chosen from the menu, whether or not it    */
  651. /*    was checked.                                                                        */
  652. /*                                                                                        */
  653. /*    NOTE:     Bevel buttons with menus actually have *two* values. The value of the         */
  654. /*            button (on/off), and the value of the menu. The menu value can be gotten    */
  655. /*            with the GetBevelButtonMenuValue helper function.                            */
  656. /*                                                                                        */
  657. /*    Handle-based Content                                                                */
  658. /*    ————————————————————                                                                */
  659. /*    You can create your control and then set the content to an existing handle to an    */
  660. /*    icon suite, etc. using the macros below. Please keep in mind that resource-based    */
  661. /*    content is owned by the control, handle-based content is owned by you. The CDEF will*/
  662. /*    not try to dispose of handle-based content. If you are changing the content type of    */
  663. /*    the button on the fly, you must make sure that if you are replacing a handle-        */
  664. /*    based content with a resource-based content to properly dispose of the handle,        */
  665. /*    else a memory leak will ensue.                                                        */
  666. /*                                                                                        */
  667.  
  668. enum {
  669.                                                                 /* Bevel Button Proc IDs */
  670.     kControlBevelButtonSmallBevelProc = 32,
  671.     kControlBevelButtonNormalBevelProc = 33,
  672.     kControlBevelButtonLargeBevelProc = 34
  673. };
  674.  
  675.  
  676. enum {
  677.                                                                 /* Bevel button graphic alignment values */
  678.     kControlBevelButtonAlignSysDirection = -1,                    /* only left or right*/
  679.     kControlBevelButtonAlignCenter = 0,
  680.     kControlBevelButtonAlignLeft = 1,
  681.     kControlBevelButtonAlignRight = 2,
  682.     kControlBevelButtonAlignTop    = 3,
  683.     kControlBevelButtonAlignBottom = 4,
  684.     kControlBevelButtonAlignTopLeft = 5,
  685.     kControlBevelButtonAlignBottomLeft = 6,
  686.     kControlBevelButtonAlignTopRight = 7,
  687.     kControlBevelButtonAlignBottomRight = 8
  688. };
  689.  
  690. typedef SInt16                             ControlButtonGraphicAlignment;
  691.  
  692. enum {
  693.                                                                 /* Bevel button text alignment values */
  694.     kControlBevelButtonAlignTextSysDirection = teFlushDefault,
  695.     kControlBevelButtonAlignTextCenter = teCenter,
  696.     kControlBevelButtonAlignTextFlushRight = teFlushRight,
  697.     kControlBevelButtonAlignTextFlushLeft = teFlushLeft
  698. };
  699.  
  700. typedef SInt16                             ControlButtonTextAlignment;
  701.  
  702. enum {
  703.                                                                 /* Bevel button text placement values */
  704.     kControlBevelButtonPlaceSysDirection = -1,                    /* if graphic on right, then on left*/
  705.     kControlBevelButtonPlaceNormally = 0,
  706.     kControlBevelButtonPlaceToRightOfGraphic = 1,
  707.     kControlBevelButtonPlaceToLeftOfGraphic = 2,
  708.     kControlBevelButtonPlaceBelowGraphic = 3,
  709.     kControlBevelButtonPlaceAboveGraphic = 4
  710. };
  711.  
  712. typedef SInt16                             ControlButtonTextPlacement;
  713. /* Add these variant codes to kBevelButtonSmallBevelProc to change the type of button */
  714.  
  715. enum {
  716.     kControlBevelButtonSmallBevelVariant = 0,
  717.     kControlBevelButtonNormalBevelVariant = (1 << 0),
  718.     kControlBevelButtonLargeBevelVariant = (1 << 1),
  719.     kControlBevelButtonMenuOnRight = (1 << 2)
  720. };
  721.  
  722. /*
  723.    Behaviors of bevel buttons. These are set up so you can add
  724.    them together with the content types.
  725. */
  726.  
  727. enum {
  728.     kControlBehaviorPushbutton    = 0,
  729.     kControlBehaviorToggles        = 0x0100,
  730.     kControlBehaviorSticky        = 0x0200,
  731.     kControlBehaviorMultiValueMenu = 0x4000,                    /* only makes sense when a menu is attached.*/
  732.     kControlBehaviorOffsetContents = 0x8000
  733. };
  734.  
  735. /* Content types supported by bevel buttons *and* image wells*/
  736.  
  737. enum {
  738.     kControlContentTextOnly        = 0,
  739.     kControlContentIconSuiteRes    = 1,
  740.     kControlContentCIconRes        = 2,
  741.     kControlContentPictRes        = 3,
  742.     kControlContentIconSuiteHandle = 129,
  743.     kControlContentCIconHandle    = 130,
  744.     kControlContentPictHandle    = 131,
  745.     kControlContentIconRef        = 132
  746. };
  747.  
  748. typedef SInt16                             ControlContentType;
  749. /* Data tags supported by the bevel button controls */
  750.  
  751. enum {
  752.     kControlBevelButtonContentTag = FOUR_CHAR_CODE('cont'),        /* ButtonContentInfo*/
  753.     kControlBevelButtonTransformTag = FOUR_CHAR_CODE('tran'),    /* IconTransformType*/
  754.     kControlBevelButtonTextAlignTag = FOUR_CHAR_CODE('tali'),    /* ButtonTextAlignment*/
  755.     kControlBevelButtonTextOffsetTag = FOUR_CHAR_CODE('toff'),    /* SInt16*/
  756.     kControlBevelButtonGraphicAlignTag = FOUR_CHAR_CODE('gali'), /* ButtonGraphicAlignment*/
  757.     kControlBevelButtonGraphicOffsetTag = FOUR_CHAR_CODE('goff'), /* Point*/
  758.     kControlBevelButtonTextPlaceTag = FOUR_CHAR_CODE('tplc'),    /* ButtonTextPlacement*/
  759.     kControlBevelButtonMenuValueTag = FOUR_CHAR_CODE('mval'),    /* SInt16*/
  760.     kControlBevelButtonMenuHandleTag = FOUR_CHAR_CODE('mhnd')    /* MenuHandle*/
  761. };
  762.  
  763. /* Structure to pass into bevel buttons and image wells to set/get content type */
  764. struct ControlButtonContentInfo {
  765.     ControlContentType                 contentType;
  766.     union {
  767.         SInt16                             resID;
  768.         CIconHandle                     cIconHandle;
  769.         Handle                             iconSuite;
  770.         Handle                             iconRef;
  771.         PicHandle                         picture;
  772.     }                                 u;
  773. };
  774. typedef struct ControlButtonContentInfo ControlButtonContentInfo;
  775.  
  776. typedef ControlButtonContentInfo *        ControlButtonContentInfoPtr;
  777. /*——————————————————————————————————————————————————————————————————————————————————————*/
  778. /*    • SLIDER (CDEF 3)                                                                    */
  779. /*——————————————————————————————————————————————————————————————————————————————————————*/
  780. /*    There are several variants that control the behavior of the slider control. Any        */
  781. /*    combination of the following three constants can be added to the basic CDEF ID        */
  782. /*    (kSliderProc).                                                                        */
  783. /*                                                                                        */
  784. /*    Variants:                                                                            */
  785. /*                                                                                        */
  786. /*        kSliderLiveFeedback         Slider does not use "ghosted" indicator when tracking.    */
  787. /*                                ActionProc is called (set via SetControlAction) as the    */
  788. /*                                indicator is dragged. The value is updated so that the    */
  789. /*                                actionproc can adjust some other property based on the    */
  790. /*                                value each time the action proc is called. If no action    */
  791. /*                                proc is installed, it reverts to the ghost indicator.    */
  792. /*                                                                                        */
  793. /*        kSliderHasTickMarks         Slider is drawn with 'tick marks'. The control            */
  794. /*                                rectangle must be large enough to accomidate the tick    */
  795. /*                                marks.                                                    */
  796. /*
  797. |*        kSliderReverseDirection    Slider thumb points in opposite direction than normal.    */
  798. /*                                If the slider is vertical, the thumb will point to the    */
  799. /*                                left, if the slider is horizontal, the thumb will point    */
  800. /*                                upwards.                                                */
  801. /*                                                                                        */
  802. /*        kSliderNonDirectional    This option overrides the kSliderReverseDirection and    */
  803. /*                                kSliderHasTickMarks variants. It creates an indicator    */
  804. /*                                which is rectangular and doesn't point in any direction    */
  805. /*                                like the normal indicator does.                            */
  806.  
  807. enum {
  808.                                                                 /* Slider proc IDs */
  809.     kControlSliderProc            = 48,
  810.     kControlSliderLiveFeedback    = (1 << 0),
  811.     kControlSliderHasTickMarks    = (1 << 1),
  812.     kControlSliderReverseDirection = (1 << 2),
  813.     kControlSliderNonDirectional = (1 << 3)
  814. };
  815.  
  816.  
  817. /*——————————————————————————————————————————————————————————————————————————————————————*/
  818. /*    • DISCLOSURE TRIANGLE (CDEF 4)                                                        */
  819. /*——————————————————————————————————————————————————————————————————————————————————————*/
  820. /*    This control can be used as either left or right facing. It can also handle its own    */
  821. /*    tracking if you wish. This means that when the 'autotoggle' variant is used, if the    */
  822. /*    user clicks the control, it's state will change automatically from open to closed    */
  823. /*    and vice-versa depending on its initial state. After a successful call to Track-    */
  824. /*     Control, you can just check the current value to see what state it was switched to.    */
  825.  
  826. enum {
  827.                                                                 /* Triangle proc IDs */
  828.     kControlTriangleProc        = 64,
  829.     kControlTriangleLeftFacingProc = 65,
  830.     kControlTriangleAutoToggleProc = 66,
  831.     kControlTriangleLeftFacingAutoToggleProc = 67
  832. };
  833.  
  834.  
  835. enum {
  836.                                                                 /* Tagged data supported by disclosure triangles */
  837.     kControlTriangleLastValueTag = FOUR_CHAR_CODE('last')        /* SInt16*/
  838. };
  839.  
  840. /*——————————————————————————————————————————————————————————————————————————————————————*/
  841. /*    • PROGRESS INDICATOR (CDEF 5)                                                        */
  842. /*——————————————————————————————————————————————————————————————————————————————————————*/
  843. /*    This CDEF implements both determinate and indeterminate progress bars. To switch,     */
  844. /*    just use SetControlData to set the indeterminate flag to make it indeterminate call    */
  845. /*    IdleControls to step thru the animation. IdleControls should be called at least        */
  846. /*    once during your event loop.                                                        */
  847. /*                                                                                        */
  848.  
  849. enum {
  850.                                                                 /* Progress Bar proc IDs */
  851.     kControlProgressBarProc        = 80
  852. };
  853.  
  854.  
  855. enum {
  856.                                                                 /* Tagged data supported by progress bars */
  857.     kControlProgressBarIndeterminateTag = FOUR_CHAR_CODE('inde') /* Boolean*/
  858. };
  859.  
  860. /*——————————————————————————————————————————————————————————————————————————————————————*/
  861. /*    • LITTLE ARROWS (CDEF 6)                                                            */
  862. /*——————————————————————————————————————————————————————————————————————————————————————*/
  863. /*     This control implements the little up and down arrows you'd see in the Memory        */
  864. /*    control panel for adjusting the cache size.                                         */
  865.  
  866. enum {
  867.                                                                 /* Little Arrows proc IDs */
  868.     kControlLittleArrowsProc    = 96
  869. };
  870.  
  871. /*——————————————————————————————————————————————————————————————————————————————————————*/
  872. /*    • CHASING ARROWS (CDEF 7)                                                            */
  873. /*——————————————————————————————————————————————————————————————————————————————————————*/
  874. /*    To animate this control, make sure to call IdleControls repeatedly.                    */
  875. /*                                                                                        */
  876.  
  877. enum {
  878.                                                                 /* Chasing Arrows proc IDs */
  879.     kControlChasingArrowsProc    = 112
  880. };
  881.  
  882. /*——————————————————————————————————————————————————————————————————————————————————————*/
  883. /*    • TABS (CDEF 8)                                                                        */
  884. /*——————————————————————————————————————————————————————————————————————————————————————*/
  885. /*    Tabs use an auxiliary resource (tab#) to hold tab information such as the tab name    */
  886. /*    and an icon suite ID for each tab.                                                    */
  887. /*                                                                                        */
  888. /*    The ID of the tab# resource that you wish to associate with a tab control should     */
  889. /*    be passed in as the Value parameter of the control. If you are using GetNewControl, */
  890. /*    then the Value slot in the CNTL resource should have the ID of the 'tab#' resource    */
  891. /*    on creation.                                                                        */
  892. /*                                                                                        */
  893.  
  894. enum {
  895.                                                                 /* Tabs proc IDs */
  896.     kControlTabLargeProc        = 128,                            /* Large tab size    */
  897.     kControlTabSmallProc        = 129                            /* Small tab size    */
  898. };
  899.  
  900.  
  901. enum {
  902.                                                                 /* Tagged data supported by progress bars */
  903.     kControlTabContentRectTag    = FOUR_CHAR_CODE('rect'),        /* Rect*/
  904.     kControlTabEnabledFlagTag    = FOUR_CHAR_CODE('enab'),        /* Boolean*/
  905.     kControlTabFontStyleTag        = kControlFontStyleTag            /* ControlFontStyleRec*/
  906. };
  907.  
  908. /*——————————————————————————————————————————————————————————————————————————————————————*/
  909. /*    • VISUAL SEPARATOR (CDEF 9)                                                            */
  910. /*——————————————————————————————————————————————————————————————————————————————————————*/
  911. /*    Separator lines determine their orientation (horizontal or vertical) automatically    */
  912. /*    based on the relative height and width of their contrlRect.                            */
  913.  
  914. enum {
  915.                                                                 /* Visual separator proc IDs */
  916.     kControlSeparatorLineProc    = 144
  917. };
  918.  
  919.  
  920. /*——————————————————————————————————————————————————————————————————————————————————————*/
  921. /*    • GROUP BOX (CDEF 10)                                                                */
  922. /*——————————————————————————————————————————————————————————————————————————————————————*/
  923. /*    The group box CDEF can be use in several ways. It can have no title, a text title,     */
  924. /*    a check box as the title, or a popup button as a title. There are two versions of     */
  925. /*    group boxes, primary and secondary, which look slightly different.                    */
  926.  
  927. enum {
  928.                                                                 /* Group Box proc IDs */
  929.     kControlGroupBoxTextTitleProc = 160,
  930.     kControlGroupBoxCheckBoxProc = 161,
  931.     kControlGroupBoxPopupButtonProc = 162,
  932.     kControlGroupBoxSecondaryTextTitleProc = 164,
  933.     kControlGroupBoxSecondaryCheckBoxProc = 165,
  934.     kControlGroupBoxSecondaryPopupButtonProc = 166
  935. };
  936.  
  937.  
  938. enum {
  939.                                                                 /* Tagged data supported by group box */
  940.     kControlGroupBoxMenuHandleTag = FOUR_CHAR_CODE('mhan'),        /* MenuHandle (popup title only)*/
  941.     kControlGroupBoxFontStyleTag = kControlFontStyleTag            /* ControlFontStyleRec*/
  942. };
  943.  
  944. /*——————————————————————————————————————————————————————————————————————————————————————*/
  945. /*    • IMAGE WELL (CDEF 11)                                                                */
  946. /*——————————————————————————————————————————————————————————————————————————————————————*/
  947. /*    Image Wells allow you to control the content type (pict/icon/etc.) shown in the     */
  948. /*    well.                                                                                */
  949. /*                                                                                        */
  950. /*    This is made possible by overloading the Min and Value parameters for the control.    */
  951. /*                                                                                        */
  952. /*    Parameter                    What Goes Here                                            */
  953. /*    ———————————————————            ——————————————————————————————————————————————————        */
  954. /*    Min                            content type (see constants for bevel buttons)            */
  955. /*    Value                        Resource ID of content type, if resource-based.            */
  956. /*                                                                                        */
  957. /*                                                                                        */
  958. /*    Checked State                                                                        */
  959. /*    —————————————                                                                        */
  960. /*    The checked state is enabled by setting the value of the control to 1, just like a     */
  961. /*    check box.                                                                            */
  962. /*                                                                                        */
  963. /*    Handle-based Content                                                                */
  964. /*    ————————————————————                                                                */
  965. /*    You can create your control and then set the content to an existing handle to an    */
  966. /*    icon suite, etc. using the macros below. Please keep in mind that resource-based    */
  967. /*    content is owned by the control, handle-based content is owned by you. The CDEF will*/
  968. /*    not try to dispose of handle-based content. If you are changing the content type of    */
  969. /*    the button on the fly, you must make sure that if you are replacing a handle-        */
  970. /*    based content with a resource-based content to properly dispose of the handle,        */
  971. /*    else a memory leak will ensue.                                                        */
  972. /*                                                                                        */
  973. /*                                                                                        */
  974. /*    AutoTracking                                                                        */
  975. /*    ————————————                                                                        */
  976. /*    Image Wells are capable of autotracking. The current autotracking feature sets the     */
  977. /*    value itself, so that the control remains hilited. It behaves as a sort of palette     */
  978. /*    type object where clicking selects it, it cannot be delected by clicking it again,     */
  979. /*    clicking on another object should cause the focus to change (as in Get Info windows)*/
  980. /*    and the application should then set the value to 0 to take away the checked border.    */
  981. /*                                                                                        */
  982.  
  983. enum {
  984.                                                                 /* Image Well proc IDs */
  985.     kControlImageWellProc        = 176,
  986.     kControlImageWellAutoTrackProc = 177
  987. };
  988.  
  989.  
  990. enum {
  991.                                                                 /* Tagged data supported by image wells */
  992.     kControlImageWellContentTag    = FOUR_CHAR_CODE('cont'),        /* ButtonContentInfo*/
  993.     kControlImageWellTransformTag = FOUR_CHAR_CODE('tran')        /* IconTransformType*/
  994. };
  995.  
  996. /*——————————————————————————————————————————————————————————————————————————————————————*/
  997. /*    • POPUP ARROW (CDEF 12)                                                                */
  998. /*——————————————————————————————————————————————————————————————————————————————————————*/
  999. /*    The popup arrow CDEF is used to draw the small arrow normally associated with a     */
  1000. /*    popup control. The arrow can point in four directions, and a small or large version */
  1001. /*    can be used. This control is provided to allow clients to draw the arrow in a         */
  1002. /*    normalized fashion which will take advantage of themes automatically.                */
  1003. /*                                                                                        */
  1004.  
  1005. enum {
  1006.                                                                 /* Popup Arrow proc IDs */
  1007.     kControlPopupArrowEastProc    = 192,
  1008.     kControlPopupArrowWestProc    = 193,
  1009.     kControlPopupArrowNorthProc    = 194,
  1010.     kControlPopupArrowSouthProc    = 195,
  1011.     kControlPopupArrowSmallEastProc = 196,
  1012.     kControlPopupArrowSmallWestProc = 197,
  1013.     kControlPopupArrowSmallNorthProc = 198,
  1014.     kControlPopupArrowSmallSouthProc = 199
  1015. };
  1016.  
  1017. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1018. /*    • PLACARD (CDEF 14)                                                                    */
  1019. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1020.  
  1021. enum {
  1022.                                                                 /* Placard proc IDs */
  1023.     kControlPlacardProc            = 224
  1024. };
  1025.  
  1026. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1027. /*    • CLOCK (CDEF 15)                                                                    */
  1028. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1029. /*     NOTE:    You can specify more options in the Value paramter when creating the clock.    */
  1030. /*            See below.                                                                    */
  1031.  
  1032. enum {
  1033.                                                                 /* Clock proc IDs */
  1034.     kControlClockTimeProc        = 240,
  1035.     kControlClockTimeSecondsProc = 241,
  1036.     kControlClockDateProc        = 242,
  1037.     kControlClockMonthYearProc    = 243
  1038. };
  1039.  
  1040. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1041. /*     These flags can be passed into 'value' field on creation of the control.            */
  1042. /*     Value is set to 0 after control is created.                                            */
  1043. /*                                                                                        */
  1044. /*    The kClockIsLive value tells the clock to automatically update on idle (clock will    */
  1045. /*    have the current time). This flag is only valid when the kClockIsDisplayOnly flag    */
  1046. /*    is set.                                                                                */
  1047. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1048.  
  1049. enum {
  1050.     kControlClockNoFlags        = 0,
  1051.     kControlClockIsDisplayOnly    = 1,
  1052.     kControlClockIsLive            = 2
  1053. };
  1054.  
  1055.  
  1056. enum {
  1057.                                                                 /* Tagged data supported by clocks */
  1058.     kControlClockLongDateTag    = FOUR_CHAR_CODE('date'),        /* LongDateRec*/
  1059.     kControlClockFontStyleTag    = kControlFontStyleTag            /* ControlFontStyleRec*/
  1060. };
  1061.  
  1062. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1063. /*    • USER PANE (CDEF 16)                                                                */
  1064. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1065.  
  1066. enum {
  1067.                                                                 /* User Pane proc IDs */
  1068.     kControlUserPaneProc        = 256
  1069. };
  1070.  
  1071. /* Tagged data supported by user panes */
  1072. /* Currently, they are all proc ptrs for doing things like drawing and hit testing, etc. */
  1073.  
  1074. enum {
  1075.     kControlUserItemDrawProcTag    = FOUR_CHAR_CODE('uidp'),        /* UserItemUPP*/
  1076.     kControlUserPaneDrawProcTag    = FOUR_CHAR_CODE('draw'),        /* ControlUserPaneDrawingUPP*/
  1077.     kControlUserPaneHitTestProcTag = FOUR_CHAR_CODE('hitt'),    /* ControlUserPaneHitTestUPP*/
  1078.     kControlUserPaneTrackingProcTag = FOUR_CHAR_CODE('trak'),    /* ControlUserPaneTrackingUPP*/
  1079.     kControlUserPaneIdleProcTag    = FOUR_CHAR_CODE('idle'),        /* ControlUserPaneIdleUPP*/
  1080.     kControlUserPaneKeyDownProcTag = FOUR_CHAR_CODE('keyd'),    /* ControlUserPaneKeyDownUPP*/
  1081.     kControlUserPaneActivateProcTag = FOUR_CHAR_CODE('acti'),    /* ControlUserPaneActivateUPP*/
  1082.     kControlUserPaneFocusProcTag = FOUR_CHAR_CODE('foci'),        /* ControlUserPaneFocusUPP*/
  1083.     kControlUserPaneBackgroundProcTag = FOUR_CHAR_CODE('back')    /* ControlUserPaneBackgroundUPP*/
  1084. };
  1085.  
  1086. typedef CALLBACK_API( void , ControlUserPaneDrawProcPtr )(ControlHandle control, SInt16 part);
  1087. typedef CALLBACK_API( ControlPartCode , ControlUserPaneHitTestProcPtr )(ControlHandle control, Point where);
  1088. typedef CALLBACK_API( ControlPartCode , ControlUserPaneTrackingProcPtr )(ControlHandle control, Point startPt, ControlActionUPP actionProc);
  1089. typedef CALLBACK_API( void , ControlUserPaneIdleProcPtr )(ControlHandle control);
  1090. typedef CALLBACK_API( ControlPartCode , ControlUserPaneKeyDownProcPtr )(ControlHandle control, SInt16 keyCode, SInt16 charCode, SInt16 modifiers);
  1091. typedef CALLBACK_API( void , ControlUserPaneActivateProcPtr )(ControlHandle control, Boolean activating);
  1092. typedef CALLBACK_API( ControlPartCode , ControlUserPaneFocusProcPtr )(ControlHandle control, ControlFocusPart action);
  1093. typedef CALLBACK_API( void , ControlUserPaneBackgroundProcPtr )(ControlHandle control, ControlBackgroundPtr info);
  1094. typedef STACK_UPP_TYPE(ControlUserPaneDrawProcPtr)                 ControlUserPaneDrawUPP;
  1095. typedef STACK_UPP_TYPE(ControlUserPaneHitTestProcPtr)             ControlUserPaneHitTestUPP;
  1096. typedef STACK_UPP_TYPE(ControlUserPaneTrackingProcPtr)             ControlUserPaneTrackingUPP;
  1097. typedef STACK_UPP_TYPE(ControlUserPaneIdleProcPtr)                 ControlUserPaneIdleUPP;
  1098. typedef STACK_UPP_TYPE(ControlUserPaneKeyDownProcPtr)             ControlUserPaneKeyDownUPP;
  1099. typedef STACK_UPP_TYPE(ControlUserPaneActivateProcPtr)             ControlUserPaneActivateUPP;
  1100. typedef STACK_UPP_TYPE(ControlUserPaneFocusProcPtr)             ControlUserPaneFocusUPP;
  1101. typedef STACK_UPP_TYPE(ControlUserPaneBackgroundProcPtr)         ControlUserPaneBackgroundUPP;
  1102. enum { uppControlUserPaneDrawProcInfo = 0x000002C0 };             /* pascal no_return_value Func(4_bytes, 2_bytes) */
  1103. enum { uppControlUserPaneHitTestProcInfo = 0x000003E0 };         /* pascal 2_bytes Func(4_bytes, 4_bytes) */
  1104. enum { uppControlUserPaneTrackingProcInfo = 0x00000FE0 };         /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  1105. enum { uppControlUserPaneIdleProcInfo = 0x000000C0 };             /* pascal no_return_value Func(4_bytes) */
  1106. enum { uppControlUserPaneKeyDownProcInfo = 0x00002AE0 };         /* pascal 2_bytes Func(4_bytes, 2_bytes, 2_bytes, 2_bytes) */
  1107. enum { uppControlUserPaneActivateProcInfo = 0x000001C0 };         /* pascal no_return_value Func(4_bytes, 1_byte) */
  1108. enum { uppControlUserPaneFocusProcInfo = 0x000002E0 };             /* pascal 2_bytes Func(4_bytes, 2_bytes) */
  1109. enum { uppControlUserPaneBackgroundProcInfo = 0x000003C0 };     /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1110. #define NewControlUserPaneDrawProc(userRoutine)                 (ControlUserPaneDrawUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneDrawProcInfo, GetCurrentArchitecture())
  1111. #define NewControlUserPaneHitTestProc(userRoutine)                 (ControlUserPaneHitTestUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneHitTestProcInfo, GetCurrentArchitecture())
  1112. #define NewControlUserPaneTrackingProc(userRoutine)             (ControlUserPaneTrackingUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneTrackingProcInfo, GetCurrentArchitecture())
  1113. #define NewControlUserPaneIdleProc(userRoutine)                 (ControlUserPaneIdleUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneIdleProcInfo, GetCurrentArchitecture())
  1114. #define NewControlUserPaneKeyDownProc(userRoutine)                 (ControlUserPaneKeyDownUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneKeyDownProcInfo, GetCurrentArchitecture())
  1115. #define NewControlUserPaneActivateProc(userRoutine)             (ControlUserPaneActivateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneActivateProcInfo, GetCurrentArchitecture())
  1116. #define NewControlUserPaneFocusProc(userRoutine)                 (ControlUserPaneFocusUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneFocusProcInfo, GetCurrentArchitecture())
  1117. #define NewControlUserPaneBackgroundProc(userRoutine)             (ControlUserPaneBackgroundUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlUserPaneBackgroundProcInfo, GetCurrentArchitecture())
  1118. #define CallControlUserPaneDrawProc(userRoutine, control, part)  CALL_TWO_PARAMETER_UPP((userRoutine), uppControlUserPaneDrawProcInfo, (control), (part))
  1119. #define CallControlUserPaneHitTestProc(userRoutine, control, where)  CALL_TWO_PARAMETER_UPP((userRoutine), uppControlUserPaneHitTestProcInfo, (control), (where))
  1120. #define CallControlUserPaneTrackingProc(userRoutine, control, startPt, actionProc)  CALL_THREE_PARAMETER_UPP((userRoutine), uppControlUserPaneTrackingProcInfo, (control), (startPt), (actionProc))
  1121. #define CallControlUserPaneIdleProc(userRoutine, control)         CALL_ONE_PARAMETER_UPP((userRoutine), uppControlUserPaneIdleProcInfo, (control))
  1122. #define CallControlUserPaneKeyDownProc(userRoutine, control, keyCode, charCode, modifiers)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppControlUserPaneKeyDownProcInfo, (control), (keyCode), (charCode), (modifiers))
  1123. #define CallControlUserPaneActivateProc(userRoutine, control, activating)  CALL_TWO_PARAMETER_UPP((userRoutine), uppControlUserPaneActivateProcInfo, (control), (activating))
  1124. #define CallControlUserPaneFocusProc(userRoutine, control, action)  CALL_TWO_PARAMETER_UPP((userRoutine), uppControlUserPaneFocusProcInfo, (control), (action))
  1125. #define CallControlUserPaneBackgroundProc(userRoutine, control, info)  CALL_TWO_PARAMETER_UPP((userRoutine), uppControlUserPaneBackgroundProcInfo, (control), (info))
  1126. /*
  1127.   ——————————————————————————————————————————————————————————————————————————————————————————
  1128.       • EDIT TEXT (CDEF 17)
  1129.   ——————————————————————————————————————————————————————————————————————————————————————————
  1130. */
  1131.  
  1132. enum {
  1133.                                                                 /* Edit Text proc IDs */
  1134.     kControlEditTextProc        = 272,
  1135.     kControlEditTextDialogProc    = 273,
  1136.     kControlEditTextPasswordProc = 274
  1137. };
  1138.  
  1139.  
  1140. enum {
  1141.                                                                 /* Tagged data supported by edit text */
  1142.     kControlEditTextStyleTag    = kControlFontStyleTag,            /* ControlFontStyleRec*/
  1143.     kControlEditTextTextTag        = FOUR_CHAR_CODE('text'),        /* Buffer of chars - you supply the buffer*/
  1144.     kControlEditTextTEHandleTag    = FOUR_CHAR_CODE('than'),        /* The TEHandle of the text edit record*/
  1145.     kControlEditTextKeyFilterTag = kControlKeyFilterTag,
  1146.     kControlEditTextSelectionTag = FOUR_CHAR_CODE('sele'),        /* EditTextSelectionRec*/
  1147.     kControlEditTextPasswordTag    = FOUR_CHAR_CODE('pass')        /* The clear text password text*/
  1148. };
  1149.  
  1150. struct ControlEditTextSelectionRec {
  1151.                                                                 /* Structure for getting the edit text selection */
  1152.     SInt16                             selStart;
  1153.     SInt16                             selEnd;
  1154. };
  1155. typedef struct ControlEditTextSelectionRec ControlEditTextSelectionRec;
  1156.  
  1157. typedef ControlEditTextSelectionRec *    ControlEditTextSelectionPtr;
  1158. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1159. /*    • STATIC TEXT (CDEF 18)                                                                */
  1160. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1161. /* Static Text proc IDs */
  1162.  
  1163. enum {
  1164.     kControlStaticTextProc        = 288
  1165. };
  1166.  
  1167. /* Tagged data supported by static text */
  1168.  
  1169. enum {
  1170.     kControlStaticTextStyleTag    = kControlFontStyleTag,            /* ControlFontStyleRec*/
  1171.     kControlStaticTextTextTag    = FOUR_CHAR_CODE('text'),        /* Copy of text*/
  1172.     kControlStaticTextTextHeightTag = FOUR_CHAR_CODE('thei')    /* SInt16*/
  1173. };
  1174.  
  1175. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1176. /*    • PICTURE CONTROL (CDEF 19)                                                            */
  1177. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1178. /*    Value parameter should contain the ID of the picture you wish to display when        */
  1179. /*    creating controls of this type. If you don't want the control tracked at all, use     */
  1180. /*    the 'no track' variant.                                                                */
  1181.  
  1182. enum {
  1183.                                                                 /* Picture control proc IDs */
  1184.     kControlPictureProc            = 304,
  1185.     kControlPictureNoTrackProc    = 305                            /* immediately returns kControlPicturePart*/
  1186. };
  1187.  
  1188. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1189. /*    • ICON CONTROL (CDEF 20)                                                            */
  1190. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1191. /*    Value parameter should contain the ID of the ICON or cicn you wish to display when    */
  1192. /*    creating controls of this type. If you don't want the control tracked at all, use     */
  1193. /*    the 'no track' variant.                                                                */
  1194. /* Icon control proc IDs */
  1195.  
  1196. enum {
  1197.     kControlIconProc            = 320,
  1198.     kControlIconNoTrackProc        = 321,                            /* immediately returns kControlIconPart*/
  1199.     kControlIconSuiteProc        = 322,
  1200.     kControlIconSuiteNoTrackProc = 323                            /* immediately returns kControlIconPart*/
  1201. };
  1202.  
  1203. /* Tagged data supported by icon controls */
  1204.  
  1205. enum {
  1206.     kControlIconTransformTag    = FOUR_CHAR_CODE('trfm'),        /* IconTransformType*/
  1207.     kControlIconAlignmentTag    = FOUR_CHAR_CODE('algn')        /* IconAlignmentType*/
  1208. };
  1209.  
  1210. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1211. /*    • WINDOW HEADER (CDEF 21)                                                            */
  1212. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1213.  
  1214. enum {
  1215.                                                                 /* Window Header proc IDs */
  1216.     kControlWindowHeaderProc    = 336,                            /* normal header*/
  1217.     kControlWindowListViewHeaderProc = 337                        /* variant for list views - no bottom line*/
  1218. };
  1219.  
  1220. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1221. /*    • LIST BOX (CDEF 22)                                                                */
  1222. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1223. /*    Lists use an auxiliary resource to define their format. The resource type used is     */
  1224. /*    'ldes' and a definition for it can be found in Appearance.r. The resource ID for     */
  1225. /*    the ldes is passed in the 'value' parameter when creating the control.                */
  1226.  
  1227. enum {
  1228.                                                                 /* List Box proc IDs */
  1229.     kControlListBoxProc            = 352,
  1230.     kControlListBoxAutoSizeProc    = 353
  1231. };
  1232.  
  1233.  
  1234. enum {
  1235.                                                                 /* Tagged data supported by list box */
  1236.     kControlListBoxListHandleTag = FOUR_CHAR_CODE('lhan'),        /* ListHandle*/
  1237.     kControlListBoxKeyFilterTag    = kControlKeyFilterTag,            /* ControlKeyFilterUPP*/
  1238.     kControlListBoxFontStyleTag    = kControlFontStyleTag            /* ControlFontStyleRec*/
  1239. };
  1240.  
  1241. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1242. /*    • PUSH BUTTON (CDEF 23)                                                                */
  1243. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1244. /*    The new standard checkbox and radio button controls support a "mixed" value that    */
  1245. /*    indicates that the current setting contains a mixed set of on and off values. The     */
  1246. /*    control value used to display this indication is defined in Controls.h:                */
  1247. /*                                                                                        */
  1248. /*        kControlCheckBoxMixedValue = 2                                                    */
  1249. /*                                                                                        */
  1250. /*    Two new variants of the standard pushbutton have been added to the standard control    */
  1251. /*    suite that draw a color icon next to the control title. One variant draws the icon    */
  1252. /*    on the left side, the other draws it on the right side (when the system justifica-    */
  1253. /*    tion is right to left, these are reversed).                                            */
  1254. /*                                                                                        */
  1255. /*    When either of the icon pushbuttons are created, the contrlMax field of the control */
  1256. /*    record is used to determine the ID of the 'cicn' resource drawn in the pushbutton.    */
  1257. /*                                                                                        */
  1258. /*    In addition, a push button can now be told to draw with a default outline using the    */
  1259. /*    SetControlData routine with the kPushButtonDefaultTag below.                        */
  1260. /*                                                                                        */
  1261.  
  1262. enum {
  1263.                                                                 /* Theme Push Button/Check Box/Radio Button proc IDs */
  1264.     kControlPushButtonProc        = 368,
  1265.     kControlCheckBoxProc        = 369,
  1266.     kControlRadioButtonProc        = 370,
  1267.     kControlPushButLeftIconProc    = 374,                            /* Standard pushbutton with left-side icon*/
  1268.     kControlPushButRightIconProc = 375                            /* Standard pushbutton with right-side icon*/
  1269. };
  1270.  
  1271.  
  1272. enum {
  1273.                                                                 /* Tagged data supported by standard buttons */
  1274.     kControlPushButtonDefaultTag = FOUR_CHAR_CODE('dflt')        /* default ring flag*/
  1275. };
  1276.  
  1277. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1278. /*    • SCROLL BAR (CDEF 24)                                                                */
  1279. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1280. /*    This is the new Appearance scroll bar.                                                */
  1281. /*                                                                                        */
  1282.  
  1283. enum {
  1284.                                                                 /* Theme Scroll Bar proc IDs */
  1285.     kControlScrollBarProc        = 384,                            /* normal scroll bar*/
  1286.     kControlScrollBarLiveProc    = 386                            /* live scrolling variant*/
  1287. };
  1288.  
  1289. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1290. /*    • POPUP BUTTON (CDEF 25)                                                            */
  1291. /*——————————————————————————————————————————————————————————————————————————————————————*/
  1292. /*    This is the new Appearance Popup Button. It takes the same variants and does the     */
  1293. /*    same overloading as the previous popup menu control. There are some differences:    */
  1294. /*                                                                                        */
  1295. /*    Passing in a menu ID of -12345 causes the popup not to try and get the menu from a    */
  1296. /*    resource. Instead, you can build the menu and later stuff the menuhandle field in     */
  1297. /*    the popup data information.                                                            */
  1298. /*                                                                                        */
  1299. /*    You can pass -1 in the Max parameter to have the control calculate the width of the    */
  1300. /*    title on its own instead of guessing and then tweaking to get it right. It adds the    */
  1301. /*    appropriate amount of space between the title and the popup.                        */
  1302. /*                                                                                        */
  1303.  
  1304. enum {
  1305.                                                                 /* Theme Popup Button proc IDs */
  1306.     kControlPopupButtonProc        = 400,
  1307.     kControlPopupFixedWidthVariant = 1 << 0,
  1308.     kControlPopupVariableWidthVariant = 1 << 1,
  1309.     kControlPopupUseAddResMenuVariant = 1 << 2,
  1310.     kControlPopupUseWFontVariant = kControlUsesOwningWindowsFontVariant
  1311. };
  1312.  
  1313. /*——————————————————————————————————————————————————————————————————————————————————*/
  1314. /* Menu Manager constants, etc.                                                        */
  1315. /*——————————————————————————————————————————————————————————————————————————————————*/
  1316.  
  1317. enum {
  1318.     kMenuStdMenuProc            = 63,
  1319.     kMenuStdMenuBarProc            = 63
  1320. };
  1321.  
  1322.  
  1323. enum {
  1324.     kMenuNoModifiers            = 0,                            /* Mask for no modifiers*/
  1325.     kMenuShiftModifier            = (1 << 0),                        /* Mask for shift key modifier*/
  1326.     kMenuOptionModifier            = (1 << 1),                        /* Mask for option key modifier*/
  1327.     kMenuControlModifier        = (1 << 2),                        /* Mask for control key modifier*/
  1328.     kMenuNoCommandModifier        = (1 << 3)                        /* Mask for no command key modifier*/
  1329. };
  1330.  
  1331.  
  1332. enum {
  1333.     kMenuNoIcon                    = 0,                            /* No icon*/
  1334.     kMenuIconType                = 1,                            /* Type for ICON*/
  1335.     kMenuShrinkIconType            = 2,                            /* Type for ICON plotted 16 x 16*/
  1336.     kMenuSmallIconType            = 3,                            /* Type for SICN*/
  1337.     kMenuColorIconType            = 4,                            /* Type for cicn*/
  1338.     kMenuIconSuiteType            = 5,                            /* Type for Icon Suite*/
  1339.     kMenuIconRefType            = 6                                /* Type for Icon Ref*/
  1340. };
  1341.  
  1342. /*——————————————————————————————————————————————————————————————————————————————————*/
  1343. /*    Appearance Manager APIs                                                            */
  1344. /*——————————————————————————————————————————————————————————————————————————————————*/
  1345. /* Registering Appearance-Savvy Applications */
  1346. EXTERN_API( OSStatus )
  1347. RegisterAppearanceClient        (void)                                                        THREEWORDINLINE(0x303C, 0x0015, 0xAA74);
  1348.  
  1349. EXTERN_API( OSStatus )
  1350. UnregisterAppearanceClient        (void)                                                        THREEWORDINLINE(0x303C, 0x0016, 0xAA74);
  1351.  
  1352. /*****************************************************************************
  1353.     NOTES ON THEME BRUSHES
  1354.     Theme brushes can be either colors or patterns, depending on the theme.
  1355.     Because of this, you should be prepared to handle the case where a brush
  1356.     is a pattern and save and restore the pnPixPat and bkPixPat fields of
  1357.     your GrafPorts when saving the fore and back colors. Also, since patterns
  1358.     in bkPixPat override the background color of the window, you should use
  1359.     BackPat to set your background pattern to a normal white pattern. This
  1360.     will ensure that you can use RGBBackColor to set your back color to white,
  1361.     call EraseRect and get the expected results.
  1362. *****************************************************************************/
  1363.  
  1364. EXTERN_API( OSStatus )
  1365. SetThemePen                        (ThemeBrush             brush,
  1366.                                  SInt16                 depth,
  1367.                                  Boolean                 colorDevice)                        THREEWORDINLINE(0x303C, 0x0001, 0xAA74);
  1368.  
  1369. EXTERN_API( OSStatus )
  1370. SetThemeBackground                (ThemeBrush             brush,
  1371.                                  SInt16                 depth,
  1372.                                  Boolean                 colorDevice)                        THREEWORDINLINE(0x303C, 0x0002, 0xAA74);
  1373.  
  1374. EXTERN_API( OSStatus )
  1375. SetThemeTextColor                (ThemeTextColor         color,
  1376.                                  SInt16                 depth,
  1377.                                  Boolean                 colorDevice)                        THREEWORDINLINE(0x303C, 0x0003, 0xAA74);
  1378.  
  1379. EXTERN_API( OSStatus )
  1380. SetThemeWindowBackground        (WindowPtr                 window,
  1381.                                  ThemeBrush             brush,
  1382.                                  Boolean                 update)                                THREEWORDINLINE(0x303C, 0x0004, 0xAA74);
  1383.  
  1384.  
  1385. /* Window Placards, Headers and Frames */
  1386. EXTERN_API( OSStatus )
  1387. DrawThemeWindowHeader            (const Rect *            rect,
  1388.                                  ThemeDrawState         state)                                THREEWORDINLINE(0x303C, 0x0005, 0xAA74);
  1389.  
  1390. EXTERN_API( OSStatus )
  1391. DrawThemeWindowListViewHeader    (const Rect *            rect,
  1392.                                  ThemeDrawState         state)                                THREEWORDINLINE(0x303C, 0x0006, 0xAA74);
  1393.  
  1394. EXTERN_API( OSStatus )
  1395. DrawThemePlacard                (const Rect *            rect,
  1396.                                  ThemeDrawState         state)                                THREEWORDINLINE(0x303C, 0x0007, 0xAA74);
  1397.  
  1398. EXTERN_API( OSStatus )
  1399. DrawThemeEditTextFrame            (const Rect *            rect,
  1400.                                  ThemeDrawState         state)                                THREEWORDINLINE(0x303C, 0x0009, 0xAA74);
  1401.  
  1402. EXTERN_API( OSStatus )
  1403. DrawThemeListBoxFrame            (const Rect *            rect,
  1404.                                  ThemeDrawState         state)                                THREEWORDINLINE(0x303C, 0x000A, 0xAA74);
  1405.  
  1406. /* Keyboard Focus Drawing */
  1407. EXTERN_API( OSStatus )
  1408. DrawThemeFocusRect                (const Rect *            rect,
  1409.                                  Boolean                 hasFocus)                            THREEWORDINLINE(0x303C, 0x000B, 0xAA74);
  1410.  
  1411. /* Dialog Group Boxes and Separators */
  1412. EXTERN_API( OSStatus )
  1413. DrawThemePrimaryGroup            (const Rect *            rect,
  1414.                                  ThemeDrawState         state)                                THREEWORDINLINE(0x303C, 0x000C, 0xAA74);
  1415.  
  1416. EXTERN_API( OSStatus )
  1417. DrawThemeSecondaryGroup            (const Rect *            rect,
  1418.                                  ThemeDrawState         state)                                THREEWORDINLINE(0x303C, 0x000D, 0xAA74);
  1419.  
  1420. EXTERN_API( OSStatus )
  1421. DrawThemeSeparator                (const Rect *            rect,
  1422.                                  ThemeDrawState         state)                                THREEWORDINLINE(0x303C, 0x000E, 0xAA74);
  1423.  
  1424.  
  1425. /*——————————————————————————————————————————————————————————————————————————————————*/
  1426. /*    Window Manager APIs                                                                */
  1427. /*——————————————————————————————————————————————————————————————————————————————————*/
  1428. EXTERN_API( OSStatus )
  1429. GetWindowFeatures                (WindowPtr                 window,
  1430.                                  UInt32 *                features)                            THREEWORDINLINE(0x303C, 0x0013, 0xAA74);
  1431.  
  1432. EXTERN_API( Boolean )
  1433. IsWindowCollapsable                (WindowPtr                 window)                                THREEWORDINLINE(0x303C, 0x000F, 0xAA74);
  1434.  
  1435. EXTERN_API( Boolean )
  1436. IsWindowCollapsed                (WindowPtr                 window)                                THREEWORDINLINE(0x303C, 0x0010, 0xAA74);
  1437.  
  1438. EXTERN_API( OSStatus )
  1439. CollapseWindow                    (WindowPtr                 window,
  1440.                                  Boolean                 collapseIt)                            THREEWORDINLINE(0x303C, 0x0011, 0xAA74);
  1441.  
  1442. EXTERN_API( OSStatus )
  1443. CollapseAllWindows                (Boolean                 collapseEm)                            THREEWORDINLINE(0x303C, 0x0012, 0xAA74);
  1444.  
  1445. EXTERN_API( OSStatus )
  1446. GetWindowRegion                    (WindowPtr                 window,
  1447.                                  WindowRegionCode         regionCode,
  1448.                                  RgnHandle                 winRgn)                                THREEWORDINLINE(0x303C, 0x0014, 0xAA74);
  1449.  
  1450. /*——————————————————————————————————————————————————————————————————————————————————*/
  1451. /*    Dialog Manager APIs                                                                */
  1452. /*——————————————————————————————————————————————————————————————————————————————————*/
  1453. EXTERN_API( DialogPtr )
  1454. NewFeaturesDialog                (void *                    wStorage,
  1455.                                  const Rect *            boundsRect,
  1456.                                  ConstStr255Param         title,
  1457.                                  Boolean                 visible,
  1458.                                  SInt16                 procID,
  1459.                                  WindowPtr                 behind,
  1460.                                  Boolean                 goAwayFlag,
  1461.                                  SInt32                 refCon,
  1462.                                  Handle                 itmLstHndl,
  1463.                                  UInt32                 flags)                                THREEWORDINLINE(0x303C, 0x110C, 0xAA68);
  1464.  
  1465. EXTERN_API( OSErr )
  1466. AutoSizeDialog                    (DialogPtr                 dialog)                                THREEWORDINLINE(0x303C, 0x020D, 0xAA68);
  1467.  
  1468. EXTERN_API( OSErr )
  1469. StandardAlert                    (AlertType                 alertType,
  1470.                                  StringPtr                 error,
  1471.                                  StringPtr                 explanation,
  1472.                                  AlertStdAlertParamPtr     alertParam,
  1473.                                  SInt16 *                itemHit)                            THREEWORDINLINE(0x303C, 0x090E, 0xAA68);
  1474.  
  1475. EXTERN_API( OSErr )
  1476. GetDialogItemAsControl            (DialogPtr                 dialog,
  1477.                                  SInt16                 itemNo,
  1478.                                  ControlHandle *        control)                            THREEWORDINLINE(0x303C, 0x050F, 0xAA68);
  1479.  
  1480. EXTERN_API( OSErr )
  1481. MoveDialogItem                    (DialogPtr                 dialog,
  1482.                                  SInt16                 itemNo,
  1483.                                  SInt16                 horiz,
  1484.                                  SInt16                 vert)                                THREEWORDINLINE(0x303C, 0x0510, 0xAA68);
  1485.  
  1486. EXTERN_API( OSErr )
  1487. SizeDialogItem                    (DialogPtr                 dialog,
  1488.                                  SInt16                 itemNo,
  1489.                                  SInt16                 height,
  1490.                                  SInt16                 width)                                THREEWORDINLINE(0x303C, 0x0511, 0xAA68);
  1491.  
  1492. /*——————————————————————————————————————————————————————————————————————————————————*/
  1493. /*    Control Manager APIs                                                            */
  1494. /*——————————————————————————————————————————————————————————————————————————————————*/
  1495. /*
  1496.    These routines are available only thru the shared library/glue
  1497.    Bevel button routines
  1498. */
  1499.  
  1500. EXTERN_API( OSErr )
  1501. GetBevelButtonMenuValue            (ControlHandle             button,
  1502.                                  SInt16 *                value);
  1503.  
  1504. EXTERN_API( OSErr )
  1505. SetBevelButtonMenuValue            (ControlHandle             button,
  1506.                                  SInt16                 value);
  1507.  
  1508. EXTERN_API( OSErr )
  1509. GetBevelButtonMenuHandle        (ControlHandle             button,
  1510.                                  MenuHandle *            handle);
  1511.  
  1512. EXTERN_API( OSErr )
  1513. GetBevelButtonContentInfo        (ControlHandle             button,
  1514.                                  ControlButtonContentInfoPtr  content);
  1515.  
  1516. EXTERN_API( OSErr )
  1517. SetBevelButtonContentInfo        (ControlHandle             button,
  1518.                                  ControlButtonContentInfoPtr  content);
  1519.  
  1520. EXTERN_API( OSErr )
  1521. SetBevelButtonTransform            (ControlHandle             button,
  1522.                                  IconTransformType         transform);
  1523.  
  1524. EXTERN_API( OSErr )
  1525. SetBevelButtonGraphicAlignment    (ControlHandle             button,
  1526.                                  ControlButtonGraphicAlignment  align,
  1527.                                  SInt16                 hOffset,
  1528.                                  SInt16                 vOffset);
  1529.  
  1530. EXTERN_API( OSErr )
  1531. SetBevelButtonTextAlignment        (ControlHandle             button,
  1532.                                  ControlButtonTextAlignment  align,
  1533.                                  SInt16                 hOffset);
  1534.  
  1535. EXTERN_API( OSErr )
  1536. SetBevelButtonTextPlacement        (ControlHandle             button,
  1537.                                  ControlButtonTextPlacement  where);
  1538.  
  1539. /* Image well routines*/
  1540.  
  1541. EXTERN_API( OSErr )
  1542. GetImageWellContentInfo            (ControlHandle             button,
  1543.                                  ControlButtonContentInfoPtr  content);
  1544.  
  1545. EXTERN_API( OSErr )
  1546. SetImageWellContentInfo            (ControlHandle             button,
  1547.                                  ControlButtonContentInfoPtr  content);
  1548.  
  1549. EXTERN_API( OSErr )
  1550. SetImageWellTransform            (ControlHandle             button,
  1551.                                  IconTransformType         transform);
  1552.  
  1553. /* Tab routines*/
  1554.  
  1555. EXTERN_API( OSErr )
  1556. GetTabContentRect                (ControlHandle             tabControl,
  1557.                                  Rect *                    contentRect);
  1558.  
  1559. EXTERN_API( OSErr )
  1560. SetTabEnabled                    (ControlHandle             tabControl,
  1561.                                  SInt16                 tabToHilite,
  1562.                                  Boolean                 enabled);
  1563.  
  1564. /* Disclosure triangles*/
  1565.  
  1566. EXTERN_API( OSErr )
  1567. SetDisclosureTriangleLastValue    (ControlHandle             tabControl,
  1568.                                  SInt16                 value);
  1569.  
  1570. /* Trap-based routines*/
  1571.  
  1572. EXTERN_API( SInt32 )
  1573. SendControlMessage                (ControlHandle             theControl,
  1574.                                  SInt16                 message,
  1575.                                  SInt32                 param)                                THREEWORDINLINE(0x303C, 0xFFFE, 0xAA73);
  1576.  
  1577. EXTERN_API( OSErr )
  1578. DumpControlHierarchy            (WindowPtr                 window,
  1579.                                  const FSSpec *            outFile)                            THREEWORDINLINE(0x303C, 0xFFFF, 0xAA73);
  1580.  
  1581. EXTERN_API( OSErr )
  1582. CreateRootControl                (WindowPtr                 window,
  1583.                                  ControlHandle *        control)                            THREEWORDINLINE(0x303C, 0x0001, 0xAA73);
  1584.  
  1585. EXTERN_API( OSErr )
  1586. GetRootControl                    (WindowPtr                 window,
  1587.                                  ControlHandle *        control)                            THREEWORDINLINE(0x303C, 0x0002, 0xAA73);
  1588.  
  1589. EXTERN_API( OSErr )
  1590. EmbedControl                    (ControlHandle             control,
  1591.                                  ControlHandle             container)                            THREEWORDINLINE(0x303C, 0x0003, 0xAA73);
  1592.  
  1593. EXTERN_API( OSErr )
  1594. AutoEmbedControl                (ControlHandle             control,
  1595.                                  WindowPtr                 window)                                THREEWORDINLINE(0x303C, 0x0004, 0xAA73);
  1596.  
  1597. EXTERN_API( Boolean )
  1598. IsControlActive                    (ControlHandle             control)                            THREEWORDINLINE(0x303C, 0x0005, 0xAA73);
  1599.  
  1600. EXTERN_API( Boolean )
  1601. IsControlVisible                (ControlHandle             control)                            THREEWORDINLINE(0x303C, 0x0006, 0xAA73);
  1602.  
  1603. EXTERN_API( OSErr )
  1604. ActivateControl                    (ControlHandle             control)                            THREEWORDINLINE(0x303C, 0x0007, 0xAA73);
  1605.  
  1606. EXTERN_API( OSErr )
  1607. DeactivateControl                (ControlHandle             control)                            THREEWORDINLINE(0x303C, 0x0008, 0xAA73);
  1608.  
  1609. EXTERN_API( ControlHandle )
  1610. FindControlUnderMouse            (Point                     where,
  1611.                                  WindowPtr                 window,
  1612.                                  SInt16 *                part)                                THREEWORDINLINE(0x303C, 0x0009, 0xAA73);
  1613.  
  1614. EXTERN_API( SInt16 )
  1615. HandleControlClick                (ControlHandle             control,
  1616.                                  Point                     where,
  1617.                                  SInt16                 modifiers,
  1618.                                  ControlActionUPP         action)                                THREEWORDINLINE(0x303C, 0x000A, 0xAA73);
  1619.  
  1620. EXTERN_API( SInt16 )
  1621. HandleControlKey                (ControlHandle             control,
  1622.                                  SInt16                 keyCode,
  1623.                                  SInt16                 charCode,
  1624.                                  SInt16                 modifiers)                            THREEWORDINLINE(0x303C, 0x000B, 0xAA73);
  1625.  
  1626. EXTERN_API( void )
  1627. IdleControls                    (WindowPtr                 window)                                THREEWORDINLINE(0x303C, 0x000C, 0xAA73);
  1628.  
  1629. EXTERN_API( OSErr )
  1630. GetKeyboardFocus                (WindowPtr                 window,
  1631.                                  ControlHandle *        control)                            THREEWORDINLINE(0x303C, 0x000D, 0xAA73);
  1632.  
  1633. EXTERN_API( OSErr )
  1634. SetKeyboardFocus                (WindowPtr                 window,
  1635.                                  ControlHandle             control,
  1636.                                  ControlFocusPart         part)                                THREEWORDINLINE(0x303C, 0x000E, 0xAA73);
  1637.  
  1638. EXTERN_API( OSErr )
  1639. AdvanceKeyboardFocus            (WindowPtr                 window)                                THREEWORDINLINE(0x303C, 0x000F, 0xAA73);
  1640.  
  1641. EXTERN_API( OSErr )
  1642. ReverseKeyboardFocus            (WindowPtr                 window)                                THREEWORDINLINE(0x303C, 0x0010, 0xAA73);
  1643.  
  1644. EXTERN_API( OSErr )
  1645. GetControlFeatures                (ControlHandle             control,
  1646.                                  UInt32 *                features)                            THREEWORDINLINE(0x303C, 0x0011, 0xAA73);
  1647.  
  1648. EXTERN_API( OSErr )
  1649. SetControlData                    (ControlHandle             control,
  1650.                                  ControlPartCode         part,
  1651.                                  ResType                 tagName,
  1652.                                  Size                     size,
  1653.                                  Ptr                     data)                                THREEWORDINLINE(0x303C, 0x0012, 0xAA73);
  1654.  
  1655. EXTERN_API( OSErr )
  1656. GetControlData                    (ControlHandle             control,
  1657.                                  ControlPartCode         part,
  1658.                                  ResType                 tagName,
  1659.                                  Size                     bufferSize,
  1660.                                  Ptr                     buffer,
  1661.                                  Size *                    actualSize)                            THREEWORDINLINE(0x303C, 0x0013, 0xAA73);
  1662.  
  1663. EXTERN_API( OSErr )
  1664. GetControlDataSize                (ControlHandle             control,
  1665.                                  ControlPartCode         part,
  1666.                                  ResType                 tagName,
  1667.                                  Size *                    maxSize)                            THREEWORDINLINE(0x303C, 0x0014, 0xAA73);
  1668.  
  1669. EXTERN_API( OSErr )
  1670. GetSuperControl                    (ControlHandle             control,
  1671.                                  ControlHandle *        parent)                                THREEWORDINLINE(0x303C, 0x0015, 0xAA73);
  1672.  
  1673. EXTERN_API( OSErr )
  1674. CountSubControls                (ControlHandle             control,
  1675.                                  SInt16 *                numChildren)                        THREEWORDINLINE(0x303C, 0x0016, 0xAA73);
  1676.  
  1677. EXTERN_API( OSErr )
  1678. GetIndexedSubControl            (ControlHandle             control,
  1679.                                  SInt16                 index,
  1680.                                  ControlHandle *        subControl)                            THREEWORDINLINE(0x303C, 0x0017, 0xAA73);
  1681.  
  1682. EXTERN_API( void )
  1683. DrawControlInCurrentPort        (ControlHandle             theControl)                            THREEWORDINLINE(0x303C, 0x0018, 0xAA73);
  1684.  
  1685. EXTERN_API( OSErr )
  1686. ClearKeyboardFocus                (WindowPtr                 window)                                THREEWORDINLINE(0x303C, 0x0019, 0xAA73);
  1687.  
  1688. EXTERN_API( OSErr )
  1689. SetControlSupervisor            (ControlHandle             control,
  1690.                                  ControlHandle             boss)                                THREEWORDINLINE(0x303C, 0x001A, 0xAA73);
  1691.  
  1692. EXTERN_API( OSErr )
  1693. GetBestControlRect                (ControlHandle             control,
  1694.                                  Rect *                    rect,
  1695.                                  SInt16 *                baseLineOffset)                        THREEWORDINLINE(0x303C, 0x001B, 0xAA73);
  1696.  
  1697. EXTERN_API( OSErr )
  1698. SetControlFontStyle                (ControlHandle             control,
  1699.                                  ControlFontStyleRec *    style)                                THREEWORDINLINE(0x303C, 0x001C, 0xAA73);
  1700.  
  1701. EXTERN_API( OSErr )
  1702. SetUpControlBackground            (ControlHandle             control,
  1703.                                  SInt16                 depth,
  1704.                                  Boolean                 colorDevice)                        THREEWORDINLINE(0x303C, 0x001D, 0xAA73);
  1705.  
  1706. EXTERN_API( OSErr )
  1707. SetControlVisibility            (ControlHandle             control,
  1708.                                  Boolean                 isVisible,
  1709.                                  Boolean                 draw)                                THREEWORDINLINE(0x303C, 0x001E, 0xAA73);
  1710.  
  1711. /*——————————————————————————————————————————————————————————————————————————————————*/
  1712. /*    Menu Manager APIs                                                                */
  1713. /*——————————————————————————————————————————————————————————————————————————————————*/
  1714. EXTERN_API( UInt32 )
  1715. MenuEvent                        (const EventRecord *    event)                                THREEWORDINLINE(0x303C, 0x020C, 0xA825);
  1716.  
  1717. EXTERN_API( OSErr )
  1718. SetMenuItemCommandID            (MenuHandle             menu,
  1719.                                  SInt16                 item,
  1720.                                  UInt32                 commandID)                            THREEWORDINLINE(0x303C, 0x0502, 0xA825);
  1721.  
  1722. EXTERN_API( OSErr )
  1723. GetMenuItemCommandID            (MenuHandle             menu,
  1724.                                  SInt16                 item,
  1725.                                  UInt32 *                commandID)                            THREEWORDINLINE(0x303C, 0x0503, 0xA825);
  1726.  
  1727. EXTERN_API( OSErr )
  1728. SetMenuItemModifiers            (MenuHandle             menu,
  1729.                                  SInt16                 item,
  1730.                                  UInt8                     modifiers)                            THREEWORDINLINE(0x303C, 0x0404, 0xA825);
  1731.  
  1732. EXTERN_API( OSErr )
  1733. GetMenuItemModifiers            (MenuHandle             menu,
  1734.                                  SInt16                 item,
  1735.                                  UInt8 *                modifiers)                            THREEWORDINLINE(0x303C, 0x0505, 0xA825);
  1736.  
  1737. EXTERN_API( OSErr )
  1738. SetMenuItemIconHandle            (MenuHandle             menu,
  1739.                                  SInt16                 item,
  1740.                                  UInt8                     iconType,
  1741.                                  Handle                 icon)                                THREEWORDINLINE(0x303C, 0x0606, 0xA825);
  1742.  
  1743. EXTERN_API( OSErr )
  1744. GetMenuItemIconHandle            (MenuHandle             menu,
  1745.                                  SInt16                 item,
  1746.                                  UInt8 *                iconType,
  1747.                                  Handle *                icon)                                THREEWORDINLINE(0x303C, 0x0707, 0xA825);
  1748.  
  1749. EXTERN_API( OSErr )
  1750. SetMenuItemTextEncoding            (MenuHandle             menu,
  1751.                                  SInt16                 item,
  1752.                                  TextEncoding             scriptID)                            THREEWORDINLINE(0x303C, 0x0408, 0xA825);
  1753.  
  1754. EXTERN_API( OSErr )
  1755. GetMenuItemTextEncoding            (MenuHandle             menu,
  1756.                                  SInt16                 item,
  1757.                                  TextEncoding *            scriptID)                            THREEWORDINLINE(0x303C, 0x0509, 0xA825);
  1758.  
  1759. EXTERN_API( OSErr )
  1760. SetMenuItemHierarchicalID        (MenuHandle             menu,
  1761.                                  SInt16                 item,
  1762.                                  SInt16                 hierID)                                THREEWORDINLINE(0x303C, 0x040D, 0xA825);
  1763.  
  1764. EXTERN_API( OSErr )
  1765. GetMenuItemHierarchicalID        (MenuHandle             menu,
  1766.                                  SInt16                 item,
  1767.                                  SInt16 *                hierID)                                THREEWORDINLINE(0x303C, 0x050E, 0xA825);
  1768.  
  1769. EXTERN_API( OSErr )
  1770. SetMenuItemFontID                (MenuHandle             menu,
  1771.                                  SInt16                 item,
  1772.                                  SInt16                 fontID)                                THREEWORDINLINE(0x303C, 0x040F, 0xA825);
  1773.  
  1774. EXTERN_API( OSErr )
  1775. GetMenuItemFontID                (MenuHandle             menu,
  1776.                                  SInt16                 item,
  1777.                                  SInt16 *                fontID)                                THREEWORDINLINE(0x303C, 0x0510, 0xA825);
  1778.  
  1779. EXTERN_API( OSErr )
  1780. SetMenuItemRefCon                (MenuHandle             menu,
  1781.                                  SInt16                 item,
  1782.                                  UInt32                 refCon)                                THREEWORDINLINE(0x303C, 0x050A, 0xA825);
  1783.  
  1784. EXTERN_API( OSErr )
  1785. GetMenuItemRefCon                (MenuHandle             menu,
  1786.                                  SInt16                 item,
  1787.                                  UInt32 *                refCon)                                THREEWORDINLINE(0x303C, 0x050B, 0xA825);
  1788.  
  1789. EXTERN_API( OSErr )
  1790. SetMenuItemRefCon2                (MenuHandle             menu,
  1791.                                  SInt16                 item,
  1792.                                  UInt32                 refCon2)                            THREEWORDINLINE(0x303C, 0x0511, 0xA825);
  1793.  
  1794. EXTERN_API( OSErr )
  1795. GetMenuItemRefCon2                (MenuHandle             menu,
  1796.                                  SInt16                 item,
  1797.                                  UInt32 *                refCon2)                            THREEWORDINLINE(0x303C, 0x0512, 0xA825);
  1798.  
  1799. EXTERN_API( OSErr )
  1800. SetMenuItemKeyGlyph                (MenuHandle             menu,
  1801.                                  SInt16                 item,
  1802.                                  SInt16                 glyph)                                THREEWORDINLINE(0x303C, 0x0513, 0xA825);
  1803.  
  1804. EXTERN_API( OSErr )
  1805. GetMenuItemKeyGlyph                (MenuHandle             menu,
  1806.                                  SInt16                 item,
  1807.                                  SInt16 *                glyph)                                THREEWORDINLINE(0x303C, 0x0514, 0xA825);
  1808.  
  1809.  
  1810. #if PRAGMA_STRUCT_ALIGN
  1811.     #pragma options align=reset
  1812. #elif PRAGMA_STRUCT_PACKPUSH
  1813.     #pragma pack(pop)
  1814. #elif PRAGMA_STRUCT_PACK
  1815.     #pragma pack()
  1816. #endif
  1817.  
  1818. #ifdef PRAGMA_IMPORT_OFF
  1819. #pragma import off
  1820. #elif PRAGMA_IMPORT
  1821. #pragma import reset
  1822. #endif
  1823.  
  1824. #ifdef __cplusplus
  1825. }
  1826. #endif
  1827.  
  1828. #endif /* __APPEARANCE__ */
  1829.  
  1830.